﻿using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Schism
{
    
    public static class ResourceBank
    {
        private static Dictionary<string, object> _ResourceBank;

        public static T Get<T>(string name)
        {
            return (T)_ResourceBank[name];
        }
        private static T LoadAsset<T>(string file)
        {
            return (T)ObjectHolder.GameObject.Content.Load<T>(file);
        }

        static ResourceBank()
        {
            _ResourceBank = new Dictionary<string, object>();

            //Todo: Add Sprite Loading Here
            _ResourceBank.Add("dungeonsheet1", LoadAsset<Texture2D>("src/gm/tilesheet_dungeon"));
            _ResourceBank.Add("celllightmap", LoadAsset<Texture2D>("src/gm/dev-tileshadow"));
            _ResourceBank.Add("actorstatecircle", LoadAsset<Texture2D>("src/gm/dev-actorstate"));
            _ResourceBank.Add("worker", LoadAsset<Texture2D>("src/gm/actor_worker"));

            _ResourceBank.Add("LightingFx", LoadAsset<Effect>("data/lightingfx"));
        }
    }
}
